/* -----------------------------------------------------------------------------
 * @system  : 공통
 * @menu    : 공통 - 팝업 레이어
 * @source  : doixBox.js
 * @desc    : 팝업 레이어
 * -----------------------------------------------------------------------------
 * VER  DATE         AUTHOR             DESCRIPTION
 * ---  -----------  -----------------  ----------------------------------------
 * 1.0  2007.06.10   김정수                               최초 작성
 * -------------------------------------------------------------------------- */

 var fileLoadingImage = context + "/images/adm/common/loading.gif";
var fileBottomNavCloseImage = context + "/images/admin/closelabel.gif";
var overlayOpacity = 0.5;   // controls transparency of shadow overlay
var animate = true;         // toggles resizing animations
var resizeSpeed = 8.6;      // controls the speed of the image resizing animations (1=slowest and 10=fastest)
var borderSize = 10;        //if you adjust the padding in the CSS, you will need to update this variable
// -----------------------------------------------------------------------------------
//
//  Global Variables
//
var imageArray = new Array;
var activeImage;
if(animate == true){
    overlayDuration = 0.3;  // shadow fade in/out duration
    if(resizeSpeed > 10){ resizeSpeed = 10;}
    if(resizeSpeed < 1){ resizeSpeed = 1;}
    resizeDuration = (11 - resizeSpeed) * 0.15;
} else {
    overlayDuration = 0;
    resizeDuration = 0;
}
// -----------------------------------------------------------------------------------

var opacity_level = 5; // how transparent our overlay bg is

var imgPreloader = new Image(); // create an preloader object
var loadCancelled = false;
var ibox_w_height = 0;
var oldPosition = "divPosition";
var currentPosition = "divPosition";

// button 정의
var btnConfirm =  '<input type="button" id="ibox_Confirm" name="ibox_Confirm" value="확인" class="btn1"/>';
var btnSave =  '<input type="button" id="ibox_Save" name="ibox_Save" value="저장" class="btn1"/>';
var btnClose =  '<input type="button" id="ibox_Close" name="ibox_Close" value="닫기" class="btn1"/>';
var btnCancel =  '<input type="button" id="ibox_Cancel" name="ibox_Cancel" value="취소" class="btn1"/>';
var btnMove =  '<input type="button" id="ibox_Move" name="ibox_Move" value="이동" class="btn1"/>';
var btnEdit =  '<input type="button" id="ibox_Edit" name="ibox_Edit" value="수정" class="btn1"/>';
var btnList =  '<input type="button" id="ibox_List" name="ibox_List" value="목록" class="btn1"/>';
var btnChange =  '<input type="button" id="ibox_Change" name="ibox_Change" value="변경" class="btn1"/>';

var box = Class.create();
box.prototype = {
    initialize : function()
    {
    	var temp = new Array();
        
        temp[temp.length] = '  <div id="overlay"></div>';
        temp[temp.length] = '  <div id="lightbox">';
        temp[temp.length] = '      <div id="outerImageContainer">';
        temp[temp.length] = '          <div id="imageContainer">';
        temp[temp.length] = '              <img id="lightboxImage">';
        temp[temp.length] = '              <div style="" id="hoverNav">';
        temp[temp.length] = '                  <a href="#" id="prevLink"></a>';
        temp[temp.length] = '                  <a href="#" id="nextLink"></a>';
        temp[temp.length] = '              </div>';
        temp[temp.length] = '              <div id="loading">';
        temp[temp.length] = '                  <a href="#" id="loadingLink">';
        temp[temp.length] = '                      <img src="images/loading.gif">';
        temp[temp.length] = '                  </a>';
        temp[temp.length] = '              </div>';
        temp[temp.length] = '          </div>';
        temp[temp.length] = '      </div>';
        temp[temp.length] = '      <div id="imageDataContainer">';
        temp[temp.length] = '          <div id="imageData">';
        temp[temp.length] = '              <div id="imageDetails">';
        temp[temp.length] = '                  <span id="caption"></span>';
        temp[temp.length] = '                  <span id="numberDisplay"></span>';
        temp[temp.length] = '              </div>';
        temp[temp.length] = '              <div id="bottomNav">';
        temp[temp.length] = '                  <a href="#" id="bottomNavClose">';
        temp[temp.length] = '                      <img src="images/close.gif">';
        temp[temp.length] = '                  </a>';
        temp[temp.length] = '              </div>';
        temp[temp.length] = '          </div>';
        temp[temp.length] = '      </div>';
        temp[temp.length] = '  </div>';
        
        var docBody = $$("body")[0];
		if( docBody)
			new Insertion.Top(docBody, temp.join(''));
			
        Element.hide($('lightboxImage'));
        Element.hide($('lightbox'));
        Element.hide($('hoverNav'));
        Element.hide($('prevLink'));
        Element.hide($('nextLink'));
    },
    showImage: function(){
        Element.hide($('loading'));
        new Effect.Appear($('lightboxImage'), { 
            duration: this.resizeDuration, 
            queue: 'end', 
            afterFinish: (function(){ this.updateDetails(); }).bind(this) 
        });
    },
    hideObject : function() {
    	$$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'hidden' });
    },
    showObject : function() {
    	$$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'visible' });
    }
}
mybox = new box();
mybox.showImage();
 